package com.company.common.function.netty.netty2;

import io.netty.channel.nio.NioEventLoopGroup;

public class ChatServer {

    public static void main(String[] args) throws Exception {
        NioEventLoopGroup bossGroup = new NioEventLoopGroup(1);
        NioEventLoopGroup workerGroup = new NioEventLoopGroup(8);
//        try{
//            ServerBootstrap bootstrap = new ServerBootstrap();
//            bootstrap.group(bossGroup,workerGroup)
//                    .channel(NioServerSocketChannel.class)
//                    .option(ChannelOption.SO_BACKLOG, 1024)
//                    .childHandler(new ChannelInitializer() {
//                        @Override
//                        protected void initChannel(ChannelInitializer ch) throws Exception {
//                            System.out.println("initChannel:" + ch.localAddress());
//                            ChannelPipeline pipeline = ch.pipeline();
//                            //加入特殊分隔符分包解码器
////                            pipeline.addLast(new DelimiterBasedFrameDecoder(1024, Unpooled.copiedBuffer("_".getBytes())));
//                            //向pipeline加入解码器
//                            pipeline.addLast("decoder", new StringDecoder());
//                            //向pipeline加入解码器
//                            pipeline.addLast("encoder", new StringDecoder());
//                            });
//                        }
//                    })
//        }catch (Exception e){
//            e.printStackTrace();
//        }


    }


}
